package com.xcity.game.employee.template;

import com.xcity.game.employee.config.impl.EmployeeRecruitConfigure;
import com.xcity.game.item.DropGroupTemplate;

import naga.x.App;
import naga.x.game.template.Template;
import naga.x.game.template.TemplateException;
import naga.x.game.template.TemplateService;
import naga.x.game.template.annotation.Excel;

/**
 * 招聘固定掉落
 * @author yang.li
 *
 */
@Excel(value = "employee.xlsx", sheetName = "招聘固定掉落")
public class EmployeeRecruitFixedDropTemplate extends Template {

	/** 钻石员工id */
	protected int stoneId;
	@Deprecated
	protected EmployeeTemplate stoneTemplate;
	protected DropGroupTemplate stoneDropTemp;

	
	/** 金币员工 */
	protected int goldId;
	protected DropGroupTemplate goldDropTemp;

	@Deprecated
	/** 高级简历员工id */
	protected int seniorResumeId;
	@Deprecated
	protected EmployeeTemplate seniorResumeTemplate;

	@Deprecated
	/** 普通简历员工id */
	protected int generalResumeId;
	@Deprecated
	protected EmployeeTemplate generalResumeTemplate;

	public int getStoneId() {
		return stoneId;
	}

	public void setStoneId(int stoneId) {
		this.stoneId = stoneId;
	}
	
	public int getGoldId() {
		return goldId;
	}

	public void setGoldId(int goldId) {
		this.goldId = goldId;
	}

	public int getSeniorResumeId() {
		return seniorResumeId;
	}

	public void setSeniorResumeId(int seniorResumeId) {
		this.seniorResumeId = seniorResumeId;
	}

	public int getGeneralResumeId() {
		return generalResumeId;
	}

	public void setGeneralResumeId(int generalResumeId) {
		this.generalResumeId = generalResumeId;
	}

	@Deprecated
	public EmployeeTemplate getEmployeeTemplate(EmployeeRecruitConfigure.Type type) {
//		if (type == EmployeeRecruitConfigure.Type.GENERAL_RESUME) {
//			return generalResumeId == 0 || generalResumeTemplate != null ? generalResumeTemplate : (generalResumeTemplate = App.getApp().getServiceManager().get(TemplateService.class).get(EmployeeTemplate.class, generalResumeId));
//		}
//		if (type == EmployeeRecruitConfigure.Type.SENIOR_RESUME) {
//			return seniorResumeId == 0 || seniorResumeTemplate != null ? seniorResumeTemplate : (seniorResumeTemplate = App.getApp().getServiceManager().get(TemplateService.class).get(EmployeeTemplate.class, seniorResumeId));
//		}
//		if (type == EmployeeRecruitConfigure.Type.STONE) {
//			return stoneId == 0 || stoneTemplate != null ? stoneTemplate : (stoneTemplate = App.getApp().getServiceManager().get(TemplateService.class).get(EmployeeTemplate.class, stoneId));
//		}
		return null;
	}
	
	public DropGroupTemplate getDropGroupTemplate(int recruitType){
		if(recruitType == EmployeeRecruitConfigure.RECRUIT_TYPE_STONE_ONE || recruitType == EmployeeRecruitConfigure.RECRUIT_TYPE_STONE_TEN){
			return stoneId == 0 || stoneDropTemp != null ? stoneDropTemp : (stoneDropTemp = App.getApp().getServiceManager().get(TemplateService.class).get(DropGroupTemplate.class, stoneId));
		}
		if(recruitType == EmployeeRecruitConfigure.RECRUIT_TYPE_MONEY_ONE || recruitType == EmployeeRecruitConfigure.RECRUIT_TYPE_MONEY_TEN
				 || recruitType == EmployeeRecruitConfigure.RECRUIT_TYPE_MONEY_HUNDRED){
			return goldId == 0 || goldDropTemp != null ? goldDropTemp : (goldDropTemp = App.getApp().getServiceManager().get(TemplateService.class).get(DropGroupTemplate.class, goldId));
		}
		return null;
	}
	
	@Override
	public void validate() throws TemplateException {}
}
